package com.niit.entity;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestUser2 {
    public static void main(String[] args) {
        ApplicationContext ctx =
                new ClassPathXmlApplicationContext(
                        "spring-config2.xml");
        // 容器根据类型获取bean
        User2 user = ctx.getBean(User2.class);
        user.test();
    }
}
